package com.ticket.sass.admin.dto.output.order;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @author ywb
 * @date 2024-03-25 14:41
 */
@Data
@ApiModel("场次信息")
public class SessionOutput {
    @ApiModelProperty(value = "开始时间")
    private LocalDateTime startTime;
    
    @ApiModelProperty(value = "开始时间")
    private String startTimeStr;
    
    @ApiModelProperty(value = "结束时间")
    private LocalDateTime enaTime;
    
    @ApiModelProperty(value = "影片名")
    private String filmName;
    @ApiModelProperty(value = "影厅名")
    private String hallName;
    @ApiModelProperty(value = "影片语言")
    private String filmLang;
    @ApiModelProperty(value = "放映版本")
    private String filmVersion;
    
    public SessionOutput() {
    }
    
    public SessionOutput(LocalDateTime startTime, LocalDateTime endTime, String filmName, String hallName, String filmLang, String filmVersion) {
        this.startTime = startTime;
        this.enaTime = endTime;
        this.filmName = filmName;
        this.hallName = hallName;
        this.filmLang = filmLang;
        this.filmVersion = filmVersion;
    }
    
    public String getStartTimeStr() {
        if (this.startTime != null) {
            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
            return this.startTime.format(formatter);
        } else {
            return "";
        }
    }
}
